package com.hushow.oneservice.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/")
@Slf4j
@Validated
@RefreshScope
public class OneController {
	
	@Value("${test.name}")
	private String name;
	
	@Value("${test.age}")
	private Integer age;
	
	@GetMapping(path = "/hello1")
    public String demo1() {
		
		return "hello 1";
	}

	
	@GetMapping(path = "/config")
    public String config() {
		return String.format("name:%s age:%s", name, age);
	}
}
